define([], function(){
    var vrcols1 = [
        {name: 'id', display: 'id', width: 10, type: 'text', disabled: false},
        {name: 'cols1', display: '时间', width: 80, type: 'text', disabled: true},
        {name: 'cols2', display: '操作内容', width: 685, type: 'text', disabled: true},
        {name: 'cols3', display: '操作人', width: 100, type: 'text', disabled: true}
    ];

    var vrcols2 = [
        {name: 'id', display: 'id', width: 10, type: 'text', disabled: false},
        {name: 'cols1', display: '时间', width: 80, type: 'text', disabled: true},
        {name: 'cols2', display: '提醒内容', width: 620, type: 'text', disabled: true},
        {name: 'cols3', display: '发送人', width: 80, type: 'text', disabled: true},
        {name: 'cols3', display: '接收人', width: 80, type: 'text', disabled: true}
    ];


    var visa_receive = avalon.define({
        $id:"visa_receiveDetail",
        vrshowContent:function (idx) {
            visa_receive.people_receive_info[idx].show = !visa_receive.people_receive_info[idx].show;
        },
        peoplename:'李小星',
        working:'在职人员',
        visatype:'[加拿大] [加拿大]个人签证',
        vrdesc:'',
        allcollect:true,
        guide:true,
        $visa_receive_gropt1:{
            checkbox:false,
            singleSelect:true,
            editable:false,
            autoLoad:true,
            pagerbar:true,
            limit:15,
            bar:false,
            loadUrl: "../json/td.visa_receive_result1.json",
            cols: vrcols1
        },
        $visa_receive_gropt2:{
            checkbox:false,
            singleSelect:true,
            editable:false,
            autoLoad:true,
            pagerbar:true,
            limit:15,
            bar:false,
            loadUrl: "../json/td.visa_receive_result2.json",
            cols: vrcols2
        },
        vrgridtab:{
            event:'click',
            tabs : [
                {
                    title: "操作记录(2)",
                    name: "base"
                },
                {
                    title: "提醒记录(2)"
                    , name: "visa"
                }
            ],
            tabpanels : [
                {content: "<div class='visa_receive_result'><aoyou:newgrid $id='visa_receive_dg' config='$visa_receive_gropt1'></aoyou:newgrid></div>"},
                {content: "<div class='visa_receive_result'><aoyou:newgrid $id='visa_receive_dg' config='$visa_receive_gropt2'></aoyou:newgrid></div>"}
            ]
        },
        people_receive_info:[
            {
                name: " 护照 <span>*</span>",
                array:[],
                obtainstatus:'门店未收',
                type:'2',
                display:'aaaaaaaa',
                content: "(1)回国后有效期在6个月以上的因私护照原件，无破损及污损，持照人签名处须有本人签名<br>(2)旧护照原件<br>(3)左右连续2页空白页<br>(4)护照首尾页复印件",
                show:false
            },
            {
                name: " 身份证 <span>*</span>",
                array:[
                    {name:"身份证原件",type:"1",obtainstatus:"门店已收"},
                    {name:"身份证复印件",type:"0",obtainstatus:"门店未收"}
                ],
                obtainstatus:'门店未收',
                type:'0',
                display:'',
                content: "第二代有效身份证正反面复印件，请复印至一张A4纸上",
                show:false
            },
            {
                name: " 照片 <span>*</span>",
                obtainstatus:'门店未收',
                array:[],
                display:'',
                type:'0',
                content: "(1)近6个月内拍摄的同一底版2张2寸免冠白底彩色照片<br>(2)尺寸：35mmx45mm",
                show:false
            },
            {
                name: " 个人信息表 <span>*</span>",
                obtainstatus:'门店未收',
                array:[],
                display:'',
                type:'0',
                content: "后附样本，请真实完整准确填写，为防止手写产生歧义现象，务必电脑填写机打；不收手填表格",
                show:false
            },
            {
                name: " 户口本 <span>*</span>",
                array:[
                    {name:"户口本原件",type:"1",obtainstatus:"门店未收"},
                    {name:"户口本复印件",type:"0",obtainstatus:"门店未收"}
                ],
                obtainstatus:'门店未收',
                type:'0',
                display:'',
                content: "(1)申请人所在户口本全部信息页复印件<br>(2)如是集体户口，请提供集体户口本首页复印件和本人页复印件或户籍证明原件",
                show:false
            },
            {
                name: " 存款证明 <span>*</span>",
                obtainstatus:'门店未收',
                array:[],
                type:'0',
                display:'',
                content: "(1)定期存单、存折或存款证明的复印件：申请人名下金额不少于5万人民币或等额外币，最好在半年前存入；<br>(2)存款证明原件不退还",
                show:false
            },
            {
                name: " 银行借记卡流水对账单 <span>*</span>",
                obtainstatus:'门店未收',
                array:[],
                type:'0',
                display:'',
                content: "(1)申请人本人名下工资或养老金卡最近6个月内流水账单明细原件(需银行柜台开具并加盖银行公章)<br>(2)申请人本人名下活期银行卡最近6个月内流水账单明细原件(需银行柜台开具并加盖银行公章)<br>(3)最后一笔交易记录须距离送签日期30天内，余额不少于3万人民币或等值外币",
                show:false
            },
            {
                name: " 婚姻状况证明 <span>*</span>",
                array:[
                    {name:"结婚证原件",type:"1"},
                    {name:"结婚证复印件",type:"0"}
                ],
                obtainstatus:'门店未收',
                type:'0',
                display:'',
                content: "(1)结婚证复印件<br>(2)离婚证复印件/法院判决书复印件",
                show:false
            },
            {
                name: " 营业执照/组织机构代码证 <span>*</span>",
                obtainstatus:'门店未收',
                array:[],
                type:'0',
                display:'',
                content: "(1)所在单位为企业单位的申请者，请提供营业执照副本的清晰复印件，用A4纸复印并在复印件上加盖单位公章<br>(2)所在单位为事业单位的申请者，请提供组织机构代码证的清晰复印件，用A4纸复印并在复印件上加盖单位公章<br>(3)若属于民间团体，请提供《注册登记证》复印件，用A4纸复印并在复印件上加盖单位公章",
                show:false
            },
            {
                name: " 在职证明 <span>*</span>",
                obtainstatus:'门店未收',
                array:[],
                type:'0',
                display:'',
                content: "请注意解释说明，(1)使用真实工作单位正规抬头纸打印(除领导签名外，其他内容须机打不能手写)，内容全部为英文，并加盖公司红章(2)在职证明内容需包括：申请人姓名、出生日期、护照号、职位、在职年限、收入、旅游时间并需注明担保申请人按期回国，旅行费用由谁支付；公司名称、地址、联系电话(座机)；以及由法人代表/总经理/人力资源部门经理(任选其一)签字，注明其联系方式及任职职务(样本后附)",
                show:false
            },
            {
                name: " 暂住证/工作居住证 <span>*</span>",
                obtainstatus:'门店未收',
                array:[
                    {name:"暂住证原件",type:"1",obtainstatus:"门店未收"},
                    {name:"暂住证复印件",type:"0",obtainstatus:"门店未收"}
                ],
                type:'0',
                display:'',
                content: "常驻地非北京领区申请人须提供有效期内的暂住证整本完整复印件，来京日期须在出发日期半年以前",
                show:false
            },
            {
                name: " 房产证明 <span>*</span>",
                obtainstatus:'门店未收',
                array:[
                    {name:"房产证明原件",type:"1",obtainstatus:"门店未收"},
                    {name:"房产证明复印件",type:"0",obtainstatus:"门店未收"}
                ],
                type:'0',
                display:'',
                content: "(1)房产证全部信息页复印件<br>(2)若没有房产证复印件，请将房产合同复印至A4纸上",
                show:false
            }
        ],
        others:[
            {name:'abcd',type:'2',display:'xxx'}
        ],

        othercontext:'',
        vrchangeStatus:function (idx,type,event) {
            if(visa_receive.people_receive_info[idx].type == type){
                visa_receive.people_receive_info[idx].type = 0;
            }else{
                visa_receive.people_receive_info[idx].type = type;
            }
            event.stopPropagation();
        },
        vrchangeStatusi:function(idx,outer,type,event){
            if(visa_receive.people_receive_info[outer].array[idx].type==type){
                visa_receive.people_receive_info[outer].array[idx].type = 0;
            }else{
                visa_receive.people_receive_info[outer].array[idx].type = type;
            }
            var status = false;
            for(var mm = 0;mm<visa_receive.people_receive_info[outer].array.length;mm++){
                if(visa_receive.people_receive_info[outer].array[mm].type==2){
                    status = true;
                }
            }
            if(status){
                visa_receive.people_receive_info[outer].type = 2;
            }else{
                visa_receive.people_receive_info[outer].type = 0;
            }
            event.stopPropagation();
        },
        vrchangeStatuso:function (idx,type,event) {
            visa_receive.others[idx].type == type?visa_receive.others[idx].type=0:visa_receive.others[idx].type = type;
            event.stopPropagation();
        },
        vraddother:function() {
            if (visa_receive.othercontext.length > 0) {
                visa_receive.others.push({name: visa_receive.othercontext, type: '0', display: ''});
                visa_receive.othercontext = '';
            }
        },
        vrdel:function(idx){
            visa_receive.others.removeAt(idx);
        },
        vrchangecollect:function(){
            visa_receive.allcollect = !visa_receive.allcollect;
        },
        vrchangeguide:function(){
            visa_receive.guide = !visa_receive.guide;
        },
        $vrlastvisapicker:{
            showpk:false,
            singleSelect:true,
            cpwidth:'250px'
        },
        vrshowdate:function(e){
            e.stopPropagation();
            avalon.vmodels['vrlastvisa'].showpk = true;
        }
        
    });
    return visa_receive;
});
